<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>child选择器</title>
    <style>


        /* .row:first-child{
                 background-color: lime;
             }

         .row:last-child{
             background-color: #ffe029;
         }
 */

        /*    .row:nth-child(2n){
                background-color: lime;
            }

           .row:nth-child(2n+1){
               background-color: #ffe029;
           }*/

        .row:nth-child(even) {
            background-color: lime;
        }

        .row:nth-child(odd) {
            background-color: #ffe029;
        }
    </style>
</head>
<body>

<div class="row">
    1
</div>
<div class="row">
    2
</div>
<div class="row">
    3
</div>
<div class="row">
    4
</div>


</body>
</html>